package sketch.seg;

import java.util.List;

import sketch.ink.SampledPoint;
import sketch.shape.Shape;
import sketch.shape.geom.prim.Line;

public class PrimApproximator {

	private Shape prim;

	private List<SampledPoint> points;

	public void setInputPoints(List<SampledPoint> ps) {
		points = ps;
		prim = null;
	}

	public List<SampledPoint> getPoints() {
		return points;
	}

	public Shape getPrim() {
		if (prim == null)
			approximate();

		return prim;
	}

	public void approximate() {
		//TODO
		prim = new Line(points.get(0).toPoint(), points.get(points.size()-1).toPoint());
	}
}
